package com.btl.component.log.mark;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

/**
 * @ Description   :
 * @ Author        :  Frank Zhang
 * @ CreateDate    :  2020/11/09
 * @ Version       :  1.0
 */
@Configuration
@EnableAspectJAutoProxy
@Slf4j
public class LogMarkAutoConfiguration implements InitializingBean {

    @Bean
    @ConditionalOnMissingBean(LogMarkAspect.class)
    public LogMarkAspect catchLogAspect() {
        return new LogMarkAspect();
    }


    @Override
    public void afterPropertiesSet()  {
        log.info("Component [log-mark] init");
    }
}
